Skip to content

Instantly share code, notes, and snippets.

@JoaoCarabetta
JoaoCarabetta / xml_to_csv.py
Last active May 10, 2024 08:41
Three lines to convert xml to csv
import xmltodict
import pandas as pd
import requests
xml = request.get('url').text
df = pd.DataFrame(xmltodict.parse(xml))
df.rename(columns=lambda x: x.replace('@', ''), inplace=True)
df.to_csv('data.csv')
@STiXzoOR
STiXzoOR / TeamViewer-15-id-changer-for-mac.py
Last active May 10, 2024 08:37 — forked from 0x2a94b5/TeamViewer-15-id-changer-for-mac.py
Teamviewer 15 ID Changer for macOS (Python 3)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# System: macOS 12+
# Version: TeamViewer v15.x.x
# Python: 3.x.x
# Command: sudo python TeamViewer-15-id-changer.py
#
import os
@ebuildy
ebuildy / index.py
Last active May 10, 2024 08:34
List gitlab container registry size, per project, via gitlab API
import gitlab
import urllib3
import humanfriendly
import timeago, datetime
# 2020-04-24T12:04:26.475+00:00
date_now = datetime.datetime.now()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@simondiep
simondiep / create-org-repo-via-github-app.md
Last active May 10, 2024 08:34
Steps to automate the creation of repos as a github app without needing user credentials
  1. Create a Github App (Organization > Settings > Developer Settings > Github Apps). This name will be publicly visible and any repo invites will show this name in the invite email.
  2. Set the permissions to read/write for repository administration and repository contents.
  3. Install the Github App for your organization (Github App > Install App)
  4. Generate a private key for your Github App
  5. Copy the Ruby Script to generate a JWT from your private key https://developer.github.com/apps/building-github-apps/authentication-options-for-github-apps/
require 'openssl'
require 'jwt' # https://rubygems.org/gems/jwt
@JBlond
JBlond / bash-colors.md
Last active May 10, 2024 08:31 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@realvjy
realvjy / ChoasLinesShader.metal
Last active May 10, 2024 08:31
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@real-jiakai
real-jiakai / ssh-snippets.md
Last active May 10, 2024 08:31
ssh工具代码脚本片段

1、debian、ubuntu更新并升级软件包

apt update && apt upgrade -y

2、docker compose重新部署

docker compose down && docker compose up -d
@nikAizuddin
nikAizuddin / Podman Installation on OpenSUSE Tumbleweed WSL2.md
Created February 25, 2023 05:56
Podman Installation on OpenSUSE Tumbleweed WSL2

Podman Installation on OpenSUSE Tumbleweed WSL2

Make sure all packages up-to-date:

sudo zypper dup

Restart OpenSUSE by executing the following command using Powershell:

wsl --shutdown openSUSE-Tumbleweed
import com.ning.http.client.*;
import jenkins.plugins.asynchttpclient.*;
import com.cloudbees.jenkins.plugins.assurance.model.*;
import org.apache.commons.lang.*;
ProxyServer proxy = AHCUtils.getProxyServer()
if (proxy != null) {
println proxy.getHost()
println proxy.getPort()
@coolsam726
coolsam726 / PrimeDatatables.vue
Last active May 10, 2024 08:28
A fully functional Vue component to work with savannabits/primevue-datatables package (Works with tailwindcss and Vue.js 3.x). NB: The usage example is based on savannabits/acacia, a backend generator I developed to make your life easier by generating code for the backend CRUDs. You can flesh out the unnecessary parts to remain with the bare-bon…
<template>
<DataTable
class="p-datatable-sm"
:value="records"
:lazy="true"
:auto-layout="true"
:paginator="true"
:rows="10"
v-model:filters="filters"
ref="dt"